package com.mars.boss.controller;

import com.mars.common.utils.FileUtils;
import com.mars.common.utils.R;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;
import javax.servlet.http.HttpServletRequest;

@RestController
@RequestMapping("/test")
public class TestController {
    /**
     * 文件上传
     * @return
     */
    @RequestMapping("/upload")
    public R upload(@RequestParam(name = "file") MultipartFile file, HttpServletRequest request){

        System.out.println(file);
        FileUtils.upload(file,"D:\\收藏\\接收文档\\测试文件\\");

        return R.ok();
    }
}
